<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <img :src="publicUrls + 'free/style9/firstLevelStyle1BackShadow.png?imageView2/3/format/webp'" alt="" class="bg-shadow" />
    <div
      class="outline-parent-bg"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style9/firstLevelStyle2Bg.png?imageView2/format/webp'})`,
      }"
    >
      <div class="outline-content-left">
        <div class="color-block" v-if="props.info.text.length < 13"></div>
        <p class="title">{{ props.info.text }}</p>
        <div class="showroom-parent" v-if="props.info.digitalShowroom">
          <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
        </div>
      </div>
      <div
        class="outline-content-right"
        :class="{
          'null-sub-title': props.info.subTitle && !props.info.value,
          'null-unit-img': !props.info.subTitle && !props.info.value,
        }"
      >
        <div
          class="outline-img-box"
          :class="{ 'outline-img-box2': !props.info.subTitle && !props.info.remarks }"
          :style="{
            backgroundImage:
              !props.info.subTitle && !props.info.remarks
                ? `url(${publicUrls + 'free/style9/firstLevelStyle2Icon2.png?imageView2/format/webp'})`
                : `url(${publicUrls + 'free/style9/firstLevelStyle2Icon.png?imageView2/format/webp'})`,
          }"
          v-if="props.info.value"
          @click="ImgVisible = true"
        >
          <img :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" class="img-icon" />
        </div>
        <div class="sub-title" v-if="props.info.subTitle">——{{ props.info.subTitle }}</div>
        <div class="line" v-if="props.info.subTitle || props.info.remarks"></div>
        <div class="remarks1" v-if="props.info.value">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="9"
          ></TextMax>
        </div>
        <div class="remarks2" v-else-if="props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="props.info.subTitle ? 16 : props.info.value ? 7 : 16"
          />
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free9Style2',
});
</script>
<script lang="ts" setup>
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style9.vue';
import TextMax from '@/freeComponents/textMode/TextMax9.vue';
import { getRemarksNum } from '@/utils/minxin';
import { publicUrls, textType } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
import { transform } from 'lodash';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();
const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style lang="less" scoped>
.outline-parent {
  position: relative;
  margin-right: 160px;
}
.bg-shadow {
  position: absolute;
  bottom: 0;
  left: 14px;
  z-index: 10;
  width: 770px;
  height: 230px;
}
.outline-parent-bg {
  position: relative;
  z-index: 11;
  width: 610px;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
}
.outline-content-left {
  position: relative;
  width: 120px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 40px;
}
.color-block {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 80px;
  background: #dcceb9;
  flex-shrink: 0;
}
.title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 645px;
  writing-mode: vertical-rl;
  color: #8a7a6a;
  text-align: center;
  font-family: 'SourceHanSerifCN';
  font-size: 32px;
  font-style: normal;
  font-weight: 700;
  line-height: 38px; /* 118.75% */
  letter-spacing: 6px;
}
.showroom-parent {
  position: relative;
  // top: 16px;
  // right: 14px;
  z-index: 21;
  width: 40px;
  height: 40px;
}
.outline-content-right {
  width: 368px;
  height: 100%;
  margin-left: 64px;
  padding: 32px 24px;
}
.null-sub-title {
  padding: 100px 24px;
  .remarks2 {
    margin-top: 70px;
  }
}
.null-unit-img {
  padding-left: 24px;
  padding-right: 24px;
  padding-top: 160px;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.outline-img-box {
  width: 322px;
  height: 380px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  box-shadow: 0px 0px 6px 0px #908570;
  display: flex;
  align-items: center;
  justify-content: center;
}
.outline-img-box2 {
  width: calc(100% + 10px);
  height: 100%;
  box-shadow: none;
  .img-icon {
    height: calc(100% - 10px);
  }
}
.img-icon {
  position: relative;
  z-index: -1;
  width: 320px;
  height: 100%;
  object-fit: contain;
  background-color: #dcceb9;
  // background-color: #d9d9d9;
}
.sub-title {
  width: 324px;
  color: #8a7a6a;
  text-align: center;
  /* 一级副标 */
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px; /* 155.556% */
  margin-top: 28px;
}
.line {
  flex-shrink: 0;
  width: 320px;
  height: 1px;
  background: #8a7a6a;
  margin-top: 20px;
}
.remarks1 {
  margin-top: 40px;
}
.remarks2 {
  margin-top: 100px;
}
</style>
